package o;

public class fyk {
    public static int ˊ = 20;
    static final /* synthetic */ boolean ˎ = (!fyk.class.desiredAssertionStatus());
    public static int ॱ = 0;
    private fzp ʻ = new fzp();
    private fzp ʼ = new fzp();
    private int[] ʽ = new int[3];
    private a ˋ = new a();
    public int ˏ = 0;
    private fzp ͺ = new fzp();
    private fzp ॱॱ = new fzp();
    private int[] ᐝ = new int[3];

    class a {
        static final /* synthetic */ boolean ʻ = (!fyk.class.desiredAssertionStatus());
        private final fzp ʼ;
        private final fzp ʽ;
        public int ˊ;
        private final fzp ˊॱ;
        public final b ˋ;
        private final fzp ˋॱ;
        public final b ˎ;
        public final b[] ˏ;
        private final fzp ˏॱ;
        private final fzp ͺ;
        public final b ॱ;
        private final fzp ॱˊ;
        private final fzp ॱˋ;
        final /* synthetic */ fyk ॱॱ;
        private final fzp ॱᐝ;
        private final fzp ᐝ;

        private a(fyk o_fyk) {
            this.ॱॱ = o_fyk;
            this.ˎ = new b();
            this.ˋ = new b();
            this.ॱ = new b();
            this.ˏ = new b[]{this.ˎ, this.ˋ, this.ॱ};
            this.ʽ = new fzp();
            this.ᐝ = new fzp();
            this.ʼ = new fzp();
            this.ˊॱ = new fzp();
            this.ˋॱ = new fzp();
            this.ˏॱ = new fzp();
            this.ॱˊ = new fzp();
            this.ͺ = new fzp();
            this.ॱᐝ = new fzp();
            this.ॱˋ = new fzp();
        }

        public void ˋ(e eVar, c cVar, fzn o_fzn, c cVar2, fzn o_fzn2) {
            if (ʻ || eVar.ˋ <= 3) {
                this.ˊ = eVar.ˋ;
                for (int i = 0; i < this.ˊ; i++) {
                    b bVar = this.ˏ[i];
                    bVar.ˏ = eVar.ˊ[i];
                    bVar.ॱॱ = eVar.ˎ[i];
                    fzp ˊ = cVar.ˊ(bVar.ˏ);
                    fzp ˊ2 = cVar2.ˊ(bVar.ॱॱ);
                    fzn.ˏ(o_fzn, ˊ, bVar.ˊ);
                    fzn.ˏ(o_fzn2, ˊ2, bVar.ˋ);
                    bVar.ˎ.ॱ(bVar.ˋ).ˎ(bVar.ˊ);
                    bVar.ॱ = 0.0f;
                }
                if (this.ˊ > 1) {
                    float f = eVar.ॱ;
                    float ˎ = ˎ();
                    if (ˎ < 0.5f * f || f * 2.0f < ˎ || ˎ < 1.1920929E-7f) {
                        this.ˊ = 0;
                    }
                }
                if (this.ˊ == 0) {
                    b bVar2 = this.ˏ[0];
                    bVar2.ˏ = 0;
                    bVar2.ॱॱ = 0;
                    fzp ˊ3 = cVar.ˊ(0);
                    fzp ˊ4 = cVar2.ˊ(0);
                    fzn.ˏ(o_fzn, ˊ3, bVar2.ˊ);
                    fzn.ˏ(o_fzn2, ˊ4, bVar2.ˋ);
                    bVar2.ˎ.ॱ(bVar2.ˋ).ˎ(bVar2.ˊ);
                    this.ˊ = 1;
                    return;
                }
                return;
            }
            throw new AssertionError();
        }

        public void ˊ(e eVar) {
            eVar.ॱ = ˎ();
            eVar.ˋ = this.ˊ;
            for (int i = 0; i < this.ˊ; i++) {
                eVar.ˊ[i] = this.ˏ[i].ˏ;
                eVar.ˎ[i] = this.ˏ[i].ॱॱ;
            }
        }

        public final void ˏ(fzp o_fzp) {
            switch (this.ˊ) {
                case 1:
                    o_fzp.ॱ(this.ˎ.ˎ).ˎ();
                    return;
                case 2:
                    this.ʽ.ॱ(this.ˋ.ˎ).ˎ(this.ˎ.ˎ);
                    o_fzp.ॱ(this.ˎ.ˎ).ˎ();
                    if (fzp.ॱ(this.ʽ, o_fzp) > 0.0f) {
                        fzp.ˎ(1.0f, this.ʽ, o_fzp);
                        return;
                    } else {
                        fzp.ˏ(this.ʽ, 1.0f, o_fzp);
                        return;
                    }
                default:
                    if (ʻ) {
                        o_fzp.ˊ();
                        return;
                    }
                    throw new AssertionError();
            }
        }

        public void ॱ(fzp o_fzp) {
            switch (this.ˊ) {
                case 0:
                    if (ʻ) {
                        o_fzp.ˊ();
                        return;
                    }
                    throw new AssertionError();
                case 1:
                    o_fzp.ॱ(this.ˎ.ˎ);
                    return;
                case 2:
                    this.ʼ.ॱ(this.ˋ.ˎ).ˊ(this.ˋ.ॱ);
                    this.ᐝ.ॱ(this.ˎ.ˎ).ˊ(this.ˎ.ॱ).ˏ(this.ʼ);
                    o_fzp.ॱ(this.ᐝ);
                    return;
                case 3:
                    o_fzp.ˊ();
                    return;
                default:
                    if (ʻ) {
                        o_fzp.ˊ();
                        return;
                    }
                    throw new AssertionError();
            }
        }

        public void ॱ(fzp o_fzp, fzp o_fzp2) {
            switch (this.ˊ) {
                case 0:
                    if (!ʻ) {
                        throw new AssertionError();
                    }
                    return;
                case 1:
                    o_fzp.ॱ(this.ˎ.ˊ);
                    o_fzp2.ॱ(this.ˎ.ˋ);
                    return;
                case 2:
                    this.ᐝ.ॱ(this.ˎ.ˊ).ˊ(this.ˎ.ॱ);
                    o_fzp.ॱ(this.ˋ.ˊ).ˊ(this.ˋ.ॱ).ˏ(this.ᐝ);
                    this.ᐝ.ॱ(this.ˎ.ˋ).ˊ(this.ˎ.ॱ);
                    o_fzp2.ॱ(this.ˋ.ˋ).ˊ(this.ˋ.ॱ).ˏ(this.ᐝ);
                    return;
                case 3:
                    o_fzp.ॱ(this.ˎ.ˊ).ˊ(this.ˎ.ॱ);
                    this.ˊॱ.ॱ(this.ˋ.ˊ).ˊ(this.ˋ.ॱ);
                    this.ˋॱ.ॱ(this.ॱ.ˊ).ˊ(this.ॱ.ॱ);
                    o_fzp.ˏ(this.ˊॱ).ˏ(this.ˋॱ);
                    o_fzp2.ॱ(o_fzp);
                    return;
                default:
                    if (!ʻ) {
                        throw new AssertionError();
                    }
                    return;
            }
        }

        public float ˎ() {
            switch (this.ˊ) {
                case 0:
                    if (ʻ) {
                        return 0.0f;
                    }
                    throw new AssertionError();
                case 1:
                    return 0.0f;
                case 2:
                    return fzm.ॱ(this.ˎ.ˎ, this.ˋ.ˎ);
                case 3:
                    this.ˊॱ.ॱ(this.ˋ.ˎ).ˎ(this.ˎ.ˎ);
                    this.ˋॱ.ॱ(this.ॱ.ˎ).ˎ(this.ˎ.ˎ);
                    return fzp.ॱ(this.ˊॱ, this.ˋॱ);
                default:
                    if (ʻ) {
                        return 0.0f;
                    }
                    throw new AssertionError();
            }
        }

        public void ˋ() {
            fzp o_fzp = this.ˎ.ˎ;
            fzp o_fzp2 = this.ˋ.ˎ;
            this.ʽ.ॱ(o_fzp2).ˎ(o_fzp);
            float f = -fzp.ˎ(o_fzp, this.ʽ);
            if (f <= 0.0f) {
                this.ˎ.ॱ = 1.0f;
                this.ˊ = 1;
                return;
            }
            float ˎ = fzp.ˎ(o_fzp2, this.ʽ);
            if (ˎ <= 0.0f) {
                this.ˋ.ॱ = 1.0f;
                this.ˊ = 1;
                this.ˎ.ˏ(this.ˋ);
                return;
            }
            float f2 = 1.0f / (ˎ + f);
            this.ˎ.ॱ = ˎ * f2;
            this.ˋ.ॱ = f * f2;
            this.ˊ = 2;
        }

        public void ˊ() {
            this.ͺ.ॱ(this.ˎ.ˎ);
            this.ॱᐝ.ॱ(this.ˋ.ˎ);
            this.ॱˋ.ॱ(this.ॱ.ˎ);
            this.ʽ.ॱ(this.ॱᐝ).ˎ(this.ͺ);
            float ˎ = fzp.ˎ(this.ͺ, this.ʽ);
            float ˎ2 = fzp.ˎ(this.ॱᐝ, this.ʽ);
            ˎ = -ˎ;
            this.ˏॱ.ॱ(this.ॱˋ).ˎ(this.ͺ);
            float ˎ3 = fzp.ˎ(this.ͺ, this.ˏॱ);
            float ˎ4 = fzp.ˎ(this.ॱˋ, this.ˏॱ);
            ˎ3 = -ˎ3;
            this.ॱˊ.ॱ(this.ॱˋ).ˎ(this.ॱᐝ);
            float ˎ5 = fzp.ˎ(this.ॱᐝ, this.ॱˊ);
            float ˎ6 = fzp.ˎ(this.ॱˋ, this.ॱˊ);
            ˎ5 = -ˎ5;
            float ॱ = fzp.ॱ(this.ʽ, this.ˏॱ);
            float ॱ2 = fzp.ॱ(this.ॱᐝ, this.ॱˋ) * ॱ;
            float ॱ3 = fzp.ॱ(this.ॱˋ, this.ͺ) * ॱ;
            ॱ *= fzp.ॱ(this.ͺ, this.ॱᐝ);
            if (ˎ <= 0.0f && ˎ3 <= 0.0f) {
                this.ˎ.ॱ = 1.0f;
                this.ˊ = 1;
            } else if (ˎ2 > 0.0f && ˎ > 0.0f && ॱ <= 0.0f) {
                ˎ3 = 1.0f / (ˎ2 + ˎ);
                this.ˎ.ॱ = ˎ2 * ˎ3;
                this.ˋ.ॱ = ˎ * ˎ3;
                this.ˊ = 2;
            } else if (ˎ4 > 0.0f && ˎ3 > 0.0f && ॱ3 <= 0.0f) {
                ˎ = 1.0f / (ˎ4 + ˎ3);
                this.ˎ.ॱ = ˎ4 * ˎ;
                this.ॱ.ॱ = ˎ * ˎ3;
                this.ˊ = 2;
                this.ˋ.ˏ(this.ॱ);
            } else if (ˎ2 <= 0.0f && ˎ5 <= 0.0f) {
                this.ˋ.ॱ = 1.0f;
                this.ˊ = 1;
                this.ˎ.ˏ(this.ˋ);
            } else if (ˎ4 <= 0.0f && ˎ6 <= 0.0f) {
                this.ॱ.ॱ = 1.0f;
                this.ˊ = 1;
                this.ˎ.ˏ(this.ॱ);
            } else if (ˎ6 <= 0.0f || ˎ5 <= 0.0f || ॱ2 > 0.0f) {
                ˎ = 1.0f / ((ॱ2 + ॱ3) + ॱ);
                this.ˎ.ॱ = ॱ2 * ˎ;
                this.ˋ.ॱ = ॱ3 * ˎ;
                this.ॱ.ॱ = ˎ * ॱ;
                this.ˊ = 3;
            } else {
                ˎ = 1.0f / (ˎ6 + ˎ5);
                this.ˋ.ॱ = ˎ6 * ˎ;
                this.ॱ.ॱ = ˎ * ˎ5;
                this.ˊ = 2;
                this.ˎ.ˏ(this.ॱ);
            }
        }
    }

    class b {
        final /* synthetic */ fyk ʽ;
        public final fzp ˊ;
        public final fzp ˋ;
        public final fzp ˎ;
        public int ˏ;
        public float ॱ;
        public int ॱॱ;

        private b(fyk o_fyk) {
            this.ʽ = o_fyk;
            this.ˊ = new fzp();
            this.ˋ = new fzp();
            this.ˎ = new fzp();
        }

        public void ˏ(b bVar) {
            this.ˊ.ॱ(bVar.ˊ);
            this.ˋ.ॱ(bVar.ˋ);
            this.ˎ.ॱ(bVar.ˎ);
            this.ॱ = bVar.ॱ;
            this.ˏ = bVar.ˏ;
            this.ॱॱ = bVar.ॱॱ;
        }
    }

    public static class c {
        static final /* synthetic */ boolean ˏ = (!fyk.class.desiredAssertionStatus());
        public float ˊ;
        public final fzp[] ˋ;
        public int ˎ;
        public final fzp[] ॱ = new fzp[fzo.ˊॱ];

        public c() {
            for (int i = 0; i < this.ॱ.length; i++) {
                this.ॱ[i] = new fzp();
            }
            this.ˋ = new fzp[2];
            this.ˎ = 0;
            this.ˊ = 0.0f;
        }

        public final void ˊ(fzg o_fzg, int i) {
            int i2 = 0;
            switch (o_fzg.ˋ()) {
                case CIRCLE:
                    fyz o_fyz = (fyz) o_fzg;
                    this.ॱ[0].ॱ(o_fyz.ˏ);
                    this.ˎ = 1;
                    this.ˊ = o_fyz.ʼ;
                    return;
                case POLYGON:
                    fzf o_fzf = (fzf) o_fzg;
                    this.ˎ = o_fzf.ˎ;
                    this.ˊ = o_fzf.ʼ;
                    while (i2 < this.ˎ) {
                        this.ॱ[i2].ॱ(o_fzf.ˏ[i2]);
                        i2++;
                    }
                    return;
                case CHAIN:
                    fza o_fza = (fza) o_fzg;
                    if (ˏ || (i >= 0 && i < o_fza.ˎ)) {
                        this.ˋ[0] = o_fza.ˏ[i];
                        if (i + 1 < o_fza.ˎ) {
                            this.ˋ[1] = o_fza.ˏ[i + 1];
                        } else {
                            this.ˋ[1] = o_fza.ˏ[0];
                        }
                        this.ॱ[0].ॱ(this.ˋ[0]);
                        this.ॱ[1].ॱ(this.ˋ[1]);
                        this.ˎ = 2;
                        this.ˊ = o_fza.ʼ;
                        return;
                    }
                    throw new AssertionError();
                case EDGE:
                    fyy o_fyy = (fyy) o_fzg;
                    this.ॱ[0].ॱ(o_fyy.ˋ);
                    this.ॱ[1].ॱ(o_fyy.ˊ);
                    this.ˎ = 2;
                    this.ˊ = o_fyy.ʼ;
                    return;
                default:
                    if (!ˏ) {
                        throw new AssertionError();
                    }
                    return;
            }
        }

        public final int ˊ(fzp o_fzp) {
            int i = 0;
            float ˎ = fzp.ˎ(this.ॱ[0], o_fzp);
            for (int i2 = 1; i2 < this.ˎ; i2++) {
                float ˎ2 = fzp.ˎ(this.ॱ[i2], o_fzp);
                if (ˎ2 > ˎ) {
                    ˎ = ˎ2;
                    i = i2;
                }
            }
            return i;
        }

        public final fzp ˊ(int i) {
            if (ˏ || (i >= 0 && i < this.ˎ)) {
                return this.ॱ[i];
            }
            throw new AssertionError();
        }
    }

    public static class e {
        public final int[] ˊ = new int[3];
        public int ˋ = 0;
        public final int[] ˎ = new int[3];
        public float ॱ = 0.0f;

        public e() {
            this.ˊ[0] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
            this.ˊ[1] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
            this.ˊ[2] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
            this.ˎ[0] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
            this.ˎ[1] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
            this.ˎ[2] = ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
        }
    }

    public final void ˏ(fym o_fym, e eVar, fyj o_fyj) {
        this.ˏ++;
        c cVar = o_fyj.ˏ;
        c cVar2 = o_fyj.ॱ;
        fzn o_fzn = o_fyj.ˎ;
        fzn o_fzn2 = o_fyj.ˋ;
        this.ˋ.ˋ(eVar, cVar, o_fzn, cVar2, o_fzn2);
        b[] bVarArr = this.ˋ.ˏ;
        this.ˋ.ॱ(this.ʻ);
        int i = 0;
        float ˏ = this.ʻ.ˏ();
        while (i < 20) {
            int i2 = this.ˋ.ˊ;
            for (int i3 = 0; i3 < i2; i3++) {
                this.ᐝ[i3] = bVarArr[i3].ˏ;
                this.ʽ[i3] = bVarArr[i3].ॱॱ;
            }
            switch (this.ˋ.ˊ) {
                case 1:
                    break;
                case 2:
                    this.ˋ.ˋ();
                    break;
                case 3:
                    this.ˋ.ˊ();
                    break;
                default:
                    if (!ˎ) {
                        throw new AssertionError();
                    }
                    break;
            }
            if (this.ˋ.ˊ != 3) {
                this.ˋ.ॱ(this.ʻ);
                float ˏ2 = this.ʻ.ˏ();
                if (ˏ2 >= ˏ) {
                    this.ˋ.ˏ(this.ॱॱ);
                } else {
                    this.ˋ.ˏ(this.ॱॱ);
                }
                if (this.ॱॱ.ˏ() >= 1.4210855E-14f) {
                    a aVar;
                    b bVar = bVarArr[this.ˋ.ˊ];
                    fzi.ˋ(o_fzn.ˏ, this.ॱॱ.ˎ(), this.ʼ);
                    bVar.ˏ = cVar.ˊ(this.ʼ);
                    fzn.ˏ(o_fzn, cVar.ˊ(bVar.ˏ), bVar.ˊ);
                    fzi.ˋ(o_fzn2.ˏ, this.ॱॱ.ˎ(), this.ʼ);
                    bVar.ॱॱ = cVar2.ˊ(this.ʼ);
                    fzn.ˏ(o_fzn2, cVar2.ˊ(bVar.ॱॱ), bVar.ˋ);
                    bVar.ˎ.ॱ(bVar.ˋ).ˎ(bVar.ˊ);
                    i++;
                    ॱ++;
                    Object obj = null;
                    int i4 = 0;
                    while (i4 < i2) {
                        if (bVar.ˏ == this.ᐝ[i4] && bVar.ॱॱ == this.ʽ[i4]) {
                            obj = 1;
                            if (obj == null) {
                                aVar = this.ˋ;
                                aVar.ˊ++;
                                ˏ = ˏ2;
                            }
                        } else {
                            i4++;
                        }
                    }
                    if (obj == null) {
                        aVar = this.ˋ;
                        aVar.ˊ++;
                        ˏ = ˏ2;
                    }
                }
            }
            ˊ = fzm.ॱ(ˊ, i);
            this.ˋ.ॱ(o_fym.ˎ, o_fym.ˊ);
            o_fym.ˏ = fzm.ॱ(o_fym.ˎ, o_fym.ˊ);
            o_fym.ˋ = i;
            this.ˋ.ˊ(eVar);
            float f;
            float f2;
            if (o_fyj.ˊ) {
                f = cVar.ˊ;
                f2 = cVar2.ˊ;
                if (o_fym.ˏ > f + f2 || o_fym.ˏ <= 1.1920929E-7f) {
                    o_fym.ˎ.ˏ(o_fym.ˊ).ˊ(0.5f);
                    o_fym.ˊ.ॱ(o_fym.ˎ);
                    o_fym.ˏ = 0.0f;
                }
                o_fym.ˏ -= f + f2;
                this.ͺ.ॱ(o_fym.ˊ).ˎ(o_fym.ˎ);
                this.ͺ.ॱ();
                this.ʼ.ॱ(this.ͺ).ˊ(f);
                o_fym.ˎ.ˏ(this.ʼ);
                this.ʼ.ॱ(this.ͺ).ˊ(f2);
                o_fym.ˊ.ˎ(this.ʼ);
                return;
            }
        }
        ˊ = fzm.ॱ(ˊ, i);
        this.ˋ.ॱ(o_fym.ˎ, o_fym.ˊ);
        o_fym.ˏ = fzm.ॱ(o_fym.ˎ, o_fym.ˊ);
        o_fym.ˋ = i;
        this.ˋ.ˊ(eVar);
        if (o_fyj.ˊ) {
            f = cVar.ˊ;
            f2 = cVar2.ˊ;
            if (o_fym.ˏ > f + f2) {
            }
            o_fym.ˎ.ˏ(o_fym.ˊ).ˊ(0.5f);
            o_fym.ˊ.ॱ(o_fym.ˎ);
            o_fym.ˏ = 0.0f;
        }
    }
}
